package com.aletto.general_store.ui.popup;

import android.content.Context;
import android.content.Intent;

import com.aletto.general_store.R;
import com.aletto.general_store.ui.activities.ShelvesHitGoodsActivity;
import com.lxj.xpopup.core.BottomPopupView;

import androidx.annotation.NonNull;

public class ShelvesHitGoodsPopup extends BottomPopupView {
    public ShelvesHitGoodsPopup(@NonNull Context context) {
        super(context);
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.popup_shelves_hit_goods;
    }

    @Override
    protected void onCreate() {
        super.onCreate();

        findViewById(R.id.cancel_button).setOnClickListener(v -> dismiss());

        findViewById(R.id.goods_layout1).setOnClickListener(v -> {
            v.getContext().startActivity(ShelvesHitGoodsActivity.newIntent(v.getContext(), 1));
            dismiss();
        });

        findViewById(R.id.goods_layout2).setOnClickListener(v -> {
            v.getContext().startActivity(ShelvesHitGoodsActivity.newIntent(v.getContext(), 2));
            dismiss();
        });
    }

}
